home *** CD-ROM | disk | FTP | other *** search
- /* getmoderange */
- #include <graphics.h>
- main()
- {
- int graphdriver,graphmode,errorcode,lomode,himode;
- /* Call detectgraph to determine hardware */
- detectgraph(&graphdriver,&graphmode);
- if(graphdriver<0)
- {
- printf("No graphics hardware available!\n");
- exit(1);
- }
- /* Now call getmoderange to determine the range of
- modes supported by this adapter and report findings */
- getmoderange(graphdriver,&lomode,&himode);
- printf("'detectgraph()' reports: ");
- switch(graphdriver)
- {
- case CGA:
- printf("Color Graphics Adapter");
- break;
- case MCGA:
- printf("Multicolor Graphics Array");
- break;
- case EGA:
- case EGA64:
- case EGAMONO:
- printf("Enhanced Graphics Adapter");
- break;
- case HERCMONO:
- printf("Hercules Color Card");
- break;
- case ATT400:
- printf("AT&T 640x400 card");
- break;
- case VGA:
- printf("Video Graphics Array or IBM 8514");
- break;
- case PC3270:
- printf("IBM PC 3270");
- break;
- }
- printf("\nwhich supports modes %d through %d\n",
- lomode,himode);
- printf("NOTE: These are not BIOS video modes \n");
- }